package com.kd.service.admin.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kd.bean.admin.Log_admin;
import com.kd.dao.admin.ILog_adminDao;
import com.kd.service.admin.ILog_adminService;

@Service
@Transactional
public class Log_adminServiceImpl implements ILog_adminService{

	@Autowired
	private ILog_adminDao log_adminDao;
	
	@Override
	public PageInfo<Log_admin> queryAllLog(Integer pageNum, Integer pageSize) throws Exception {
		PageHelper.startPage(pageNum, pageSize);
		List<Log_admin> list = log_adminDao.queryAllLog();
		PageInfo<Log_admin> info = new PageInfo<>(list);
		return info;
	}

	@Override
	public Boolean insertLog(Log_admin log_admin) throws Exception {
		log_admin.setLog_create_time(new Date());
		return log_adminDao.insertLog(log_admin)>0;
	}

	@Override
	public Log_admin queryLogMessageByLog_id(Integer log_id) throws Exception {
		
		return log_adminDao.queryLogMessageByLog_id(log_id);
	}

}
